﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace lcmyjobs.Web.login_log
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                       
        }

        		protected void btnSave_Click(object sender, EventArgs e)
		{
			
			string strErr="";
			if(!PageValidate.IsDateTime(txtlogin_time.Text))
			{
				strErr+="login_time格式错误！\\n";	
			}
			if(this.txtlogin_ip.Text.Trim().Length==0)
			{
				strErr+="login_ip不能为空！\\n";	
			}
			if(this.txtlogin_name.Text.Trim().Length==0)
			{
				strErr+="login_name不能为空！\\n";	
			}

			if(strErr!="")
			{
				MessageBox.Show(this,strErr);
				return;
			}
			DateTime login_time=DateTime.Parse(this.txtlogin_time.Text);
			string login_ip=this.txtlogin_ip.Text;
			string login_name=this.txtlogin_name.Text;

			lcmyjobs.Model.login_log model=new lcmyjobs.Model.login_log();
			model.login_time=login_time;
			model.login_ip=login_ip;
			model.login_name=login_name;

			lcmyjobs.BLL.login_log bll=new lcmyjobs.BLL.login_log();
			bll.Add(model);
			Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功！","add.aspx");

		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
